import cookies from "vue-cookies";
const public_key_id = "public_key";
const accessToken = "asopdj"
const RefreshToken = "asdajoi"
    // 设置AccessToken 时限为1天
export const setAccessToken = (token) => {
    cookies.set(accessToken, "Bearer " + token, {
        expires: 1,
        httpOnly: true,
    });
};
export const getAccessToken = () => {
    return cookies.get(accessToken);
};
export const removeAccessToken = () => {
    cookies.remove(accessToken);
};
// 设置RefreshToken
export const setRefreshToken = (token) => {
    cookies.set(RefreshToken, "Bearer " + token, {
        expires: 15,
        httpOnly: true,
    });
};
export const getRefreshToken = () => {
    return cookies.get(RefreshToken);
};
export const removeRefreshToken = () => {
    cookies.remove(RefreshToken);
};
export const getPublicKey = () => {
    return sessionStorage.getItem(public_key_id);
};
export const setPublicKey = (publicKey) => {
    return sessionStorage.setItem(public_key_id, publicKey);
};
export const removePublicKey = () => {
    return sessionStorage.removeItem(public_key_id);
};